package com.woniuxy.commons.service.sale.factory;

import com.woniuxy.commons.result.Result;
import com.woniuxy.commons.service.sale.PurchaseManagerService;
import feign.hystrix.FallbackFactory;

/**
 * @author: CHL  <br/>
 * @ToDo: 服务降级工厂
 * Date: 2022/4/25:14:58  <br/>
 * Description:
 */
public class PurchaseManagerServiceFactory implements FallbackFactory<PurchaseManagerService> {
    @Override
    public PurchaseManagerService create(Throwable throwable) {
        return new PurchaseManagerService() {
            @Override
            public Result selectAll() {
                return Result.fail().message("请稍后重试");
            }
            @Override
            public Result getPurchaseOrder(Integer purchaseOrderId) {
                return Result.fail().message("请稍后重试");
            }
            @Override
            public Result getPurchaseOrderGoodsByOrderId(Integer purchaseOrderId) {
                return Result.fail().message("请稍后重试");
            }
        };
    }
}
